import Vue from 'vue'
import Router from 'vue-router'
import Home from '../views/Home.vue'
import Intro from '../views/Intro.vue'
import About from '../views/About.vue'
import Tab from '../components/Tab.vue'
import PageRouter from './pageRouter'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Tab',
      component: Tab,
      redirect:'/home',//从定向到首页
      children:[{
        path:'/home',
        name:'Home',
        component: Home,
        meta:{
          requireAuth:true
        }
      }, {
        path:'/intro',
        name:'Intro',
        component: Intro,
        meta:{
          requireAuth:true
        }
      }, {
        path:'/about',
        name:'About',
        component: About,
        meta:{
          requireAuth:true
        }
      }]
    },
    ...PageRouter
  ]
})
